/*******************************************************************************
 * Copyright (c) 2010 Sylvain Sicard.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v2.1
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * 
 * Contributors:
 *     Sylvain Sicard - initial API and implementation
 ******************************************************************************/
package com.googlecode.ssdutils.beanconverter.asm;

import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

import com.googlecode.ssdutils.beanconverter.api.BeanConverter;


/**
 * @author Sylvain Sicard
 * 
 */
public class InternalClassNamesUtil {

	public static final String OBJECT_ICN = getInternalName(Object.class);

	public static final String CLASS_ICN = getInternalName(Class.class);

	public static final String COLLECTION_ICN = getInternalName(Collection.class);

	public static final String ITERATOR_ICN = getInternalName(Iterator.class);

	public static final String MAP_ICN = getInternalName(Map.class);

	public static final String MAP_ENTRY_ICN = getInternalName(Map.Entry.class);

	public static final String STRING_ICN = getInternalName(String.class);

	public static final String SET_ICN = getInternalName(Set.class);

	public static final String BEANCONVERTER_ICN = getInternalName(BeanConverter.class);

	/**
	 * @param from
	 * @return
	 */
	public static String getInternalName(Class<?> c) {
		return getInternalName(c.getName());

	}

	/**
	 * @param className
	 * @return
	 */
	public static String getInternalName(String className) {
		return className.replace('.', '/');
	}

	/**
	 * @param className
	 * @return
	 */
	public static String getExternalName(String className) {
		return className.replace('/', '.');
	}

}
